package jps_s10996_s7175.objects;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import edu.pjwstk.jps.datastore.IComplexObject;
import edu.pjwstk.jps.datastore.IOID;

public class ComplexObject extends SBAObject<Collection<IOID>> implements
		IComplexObject {

	private List<IOID> childs;

	public ComplexObject(String name, DBID id, List<IOID> childs) {
		super(name, id, childs);
		this.childs = childs;
		if (childs == null) {
			this.childs = new LinkedList<IOID>();
		}
	}

	public void add(IOID ojb) {
		this.childs.add(ojb);
	}

	public void addChildElement(SBAObject<Object> obj) {
		this.childs.add(obj.getOID());
	}

	public void addChildElement(IOID obj) {
		this.childs.add(obj);
	}

	@Override
	public List<IOID> getChildOIDs() {
		return this.childs;
	}

}
